<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>ztm.me自定义推广页</title>
    <!-- 最新版本的 Bootstrap 核心 CSS 文件 -->
    <link rel="stylesheet" href="/static/bs/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
    <!-- 可选的 Bootstrap 主题文件（一般不用引入） -->
    <link rel="stylesheet" href="/static/bs/3.3.7/css/bootstrap-theme.min.css" integrity="sha384-rHyoN1iRsVXV4nD0JutlnGaslCJuC7uwjduW9SVrLvRYooPp2bWYgmgJQIXwl/Sp" crossorigin="anonymous">
    <!-- 最新的 Bootstrap 核心 JavaScript 文件 -->
    <script src="/static/bs/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
</head>
<body>
    <form method="POST">{% csrf_token %}
        <div class="form-group has-success has-feedback">
            <label class="control-label" for="inputGroupSuccess1">请选择类型和输入JD商品URL</label>
            <label class="radio-inline">
                <input type="radio" name="channel" id="inlineRadio1" value="PC" {% if channel == 'PC'%}checked{% endif %}>PC
            </label>
            <label class="radio-inline">
                <input type="radio" name="channel" id="inlineRadio2" value="ML" {% if channel == 'ML'%}checked{% endif %}>ML
            </label>
            <div class="input-group">
                <span class="input-group-addon">URL</span>
                <input type="text" name="url" class="form-control" id="inputGroupSuccess1" aria-describedby="inputGroupSuccess1Status" value="{{url}}">
            </div>
            <span class="glyphicon glyphicon-ok form-control-feedback" aria-hidden="true"></span>
            <span id="inputGroupSuccess1Status" class="sr-only">(success)</span>
        </div>
        <button type="submit" class="btn btn-primary"> 提 交 </button>
      </form>
      {%if ret %}
        <h3>{{ret.msg}}(code={{ret.code}})</h3>
        {% if ret.url %}
            <a href="{{ret.url}}" target="_blank">{{ret.url}}</a>
        {% endif %}
      {% endif %}
</body>
</html>